﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8" />
    <title>选择模版</title>
    <link href="../../Scripts/easyUI145/themes/color.css" rel="stylesheet" />
    <link href="../../Scripts/easyUI145/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/easyUI/jquery-1.8.0.min.js" type="text/javascript"></script>
    <script src="../../Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../Scripts/EasyUIUtility.js" type="text/javascript"></script>
    <link href="../../Scripts/SyntaxHighlighter/Styles/shCoreDefault.css" rel="stylesheet"
          type="text/css" />
    <script src="../../Scripts/SyntaxHighlighter/shCore.js" type="text/javascript"></script>
    <script src="../../Scripts/SyntaxHighlighter/shBrushCSharp.js" type="text/javascript"></script>
    <script src="../../Scripts/QueryString.js" type="text/javascript"></script>

    <script src="../../Comm/JScript.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Scripts/config.js"></script>
    <script type="text/javascript" src="../../Comm/Gener.js"></script>
    <script src="../Admin.js"></script>
    <script language="javascript" type="text/javascript">
        $(function () {
            $("#pageloading").show();
            InitDocTemp();
            $("#pageloading").hide();
        });
        function InitDocTemp() {
            var pkval = GetQueryString("FK_Node");
            if (pkval == "") {
                $.messager.alert("提示", "参数错误。");
                return;
            }

            //提交数据
            var doMethod = "GetDocTemp";
            var httpHandlerName = "BP.WF.HttpHandler.WF_Admin_AttrNode";
            $("#cc").form("submit", {
                type: 'POST',
                dataType: 'html',
                url: dynamicHandler + "?DoType=HttpHandler&DoMethod=" + doMethod + "&HttpHandlerName=" + httpHandlerName + "&pkval=" + pkval,
                onSubmit: function (param) {
                    //return false; //这里可以做表单的验证，如果验证失败，就return false 来终止表单提交
                },
                success: function (data) {
                    $("#pageloading").hide();

                    if (data.indexOf('err@') == 0) {
                        alert(data);
                        return;
                    } else {
                        var json = eval('(' + data + ')');

                        for (var i = 0; i < json.length; i++) {
                            $('#docTempList').append('<li id="doc_' + json[i].No + '"><span>' + json[i].Name + '</span>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\'javascript:ImportDocTemp(\"' + json[i].No + '\")\'>导入</a></li>');
                        }
                    }
                }
            });
        }
        function ImportDocTemp(id) {
            if (confirm("确认开始导入模板吗？")) {
                $("#pageloading").show();

                var nodeId = GetQueryString("FK_Node");
                var workId = GetQueryString("WorkID");
                var fk_flow = GetQueryString("FK_Flow");

                //提交数据
                var doMethod = "ImportDocTemp";
                var httpHandlerName = "BP.WF.HttpHandler.WF_Admin_AttrNode";
                $("#cc").form("submit", {
                    type: 'POST',
                    dataType: 'html',
                    url: dynamicHandler + "?DoType=HttpHandler&DoMethod=" + doMethod + "&HttpHandlerName=" + httpHandlerName + "&no=" + id +
                        "&nodeId=" + nodeId + "&workId=" + workId + "&fk_flow=" + fk_flow,
                    onSubmit: function (param) {
                        //return false;
                    },
                    success: function (data) {
                        $("#pageloading").hide();
                        if (data.indexOf('err@') == 0) {
                            alert(data);
                        } else {
                            $('body').append('<a id="opvsto"    href="">vsto操作</a>');
                            $('#opvsto').attr('href', GetQueryString("op"));
                            $('#opvsto')[0].click();

                            //$('#opvsto').remove();
                        }
                        window.close();
                    }
                });
            }
        }
    </script>
</head>
<body>
    <form id="cc" name="cc" action="" enctype="multipart/form-data" method="post">
        <fieldset>
            <legend>模板列表</legend>
            <a id="sasasas"></a>
            <ul>
                <li>
                    模板列表:
                    <ul id="docTempList">
                    </ul>
                </li>
            </ul>
        </fieldset>
    </form>
</body>
</html>
